<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<div style="margin: 10px">
<c:choose>
	<c:when test="${page.total == 0}"><!-- 没有文章 -->
		<p>此栏目没有文章</p>
	</c:when>
	<c:when test="${page.total == 1}"><!-- 只有一篇文章 -->
		<p style="font-size: 20px;text-align: center;padding: 10px 0">${page.rows[0].title }</p>
		<div style="border-bottom: 1px solid #DDD; margin: 10px 0"></div>
		<p>${page.rows[0].content }</p>
	</c:when>
	<c:otherwise><!--文章列表 -->
		<ul id="artList">
			<c:forEach items="${page.rows }" var="art">
				<li>
					<a href="<%=request.getContextPath()%>/site/viewArticle.do?articleId=${art.id}" target="_blank">${art.title }</a>
					<span style="float: right;">${art.writeDateStr }</span>
				</li>
			</c:forEach>
		</ul>
		<c:if test="${totalPage > 1}">
			<div>
				<div id="pagenation" style="margin: 10px 0"></div>
				<script type="text/javascript">
					$("#pagenation").myPagination({
						cssStyle:'digg',
						currPage : '${currPage}',
						pageCount : '${totalPage}',
						pageSize : 5,
						ajax: {
				            on: false,
				            onClick: function(page) {
				            	window.location = "<%=request.getContextPath()%>/site/column.do?columnId=${columnId}&subColumnId=${subColumnId}&rows=10&page="+page;
				            }
						}
					});
				</script>
			</div>
		</c:if>
	</c:otherwise>
</c:choose>
</div>